package com.demo.richText.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description  自定义静态资源映射
 * @Author 小乌龟
 * @Date 2022/2/18 16:13
 */

@Configuration
public class FileUploadConfig implements WebMvcConfigurer {
    @Autowired
    private WebAppDataProperties webAppDataProperties;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(webAppDataProperties.getPathPattern())
                .addResourceLocations(webAppDataProperties.getResourceLocation());
    }
}